#!/bin/bash
. $(dirname $0)/config.sh

cd $LOCAL_HOMEDIR

case "$1" in
    dist)
	$(dirname $0)/syncKernels.sh $KERNELDIR
	$(dirname $0)/syncClients.sh $KERNELDIR
	;;

    maps)
	$(dirname $0)/syncKernels.sh $MAPDIR
	;;
    code)
	if [ ! -z "$2" ]; then
	    $(dirname $0)/syncClients.sh $CODEDIR/$2 $CODEDIR/
	else
	    $(dirname $0)/syncClients.sh $CODEDIR 
	fi
	;;

    logs)
	$(dirname $0)/gatherFromClients.sh $LOGDIR $HOME
	$(dirname $0)/gatherFromKernels.sh $LOGDIR $HOME
	;;

    all)
	$(dirname $0)/syncKernels.sh $KERNELDIR
	$(dirname $0)/syncClients.sh $KERNELDIR
	$(dirname $0)/syncKernels.sh $MAPDIR
	$(dirname $0)/syncClients.sh $CODEDIR

	$(dirname $0)/gatherFromClients.sh $LOGDIR $HOME
	$(dirname $0)/gatherFromKernels.sh $LOGDIR $HOME
	;;
esac
